import React from 'react'

type Props = {}
// 继承
class a1 {
  title:string;
  constructor(title:string){
    this.title=title
  }
}
class a2 extends a1{
  age:number;
  constructor(age:number,title:string) {
    super(title)
    this.age=age
  }
}
console.log(new a2(111,"111"))

// 封装函数
type Difference=(a:number,b:number)=>number;
const difference:Difference=function(a,b){
  return a-b
}
// 排序
const arr=[2,1,4,3];
const arr1=arr.sort((a,b)=>a-b);
console.log(arr1)

// 最大差值
const str=[1,6,7,9];
const str1=str.sort()
const str2=str1[str1.length-1]-str1[0]

console.log(difference(30,10))
const App = (props: Props) => {
  return (
    <div>App</div>
  )
}
export default App